using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Media;

namespace Zephyris_Space_Mercs
{
    class MapDef
    {
        private List<Element> mapElements = new List<Element>();
        private Model station1;
        private Model station2;
        private Model station3;
        private Model nebula;
        private Model asteroid;

        private CollisionDetector collisionDetector = new CollisionDetector();

        private void ContentLoad(ContentManager Content)
        {
            station1 = Content.Load<Model>("Elements\\Stations\\Station1");
            station2 = Content.Load<Model>("Elements\\Stations\\Station2");
            station3 = Content.Load<Model>("Elements\\Stations\\Station3");
        }

        public MapDef(MapTypes.MapType mapType, ContentManager Content)
        {
            ContentLoad(Content);

            Element element = new Element();

            switch (mapType)
            {
                case MapTypes.MapType.Map1:
                    {
                        element = new Element();
                        element.model = station2;
                        element.position = new Vector3(10, 0, 0);
                        element.boundingSphere = collisionDetector.GetBoundingSphere(element.position, element.model, 1.0f);
                        element.radius = element.boundingSphere.Radius;
                        element.type = ElementTypes.ElementType.Station;
                        mapElements.Add(element);

                        element = new Element();
                        element.model = station1;
                        element.position = new Vector3(3, 0, 0);
                        element.boundingSphere = collisionDetector.GetBoundingSphere(element.position, element.model, 1.0f);
                        element.radius = element.boundingSphere.Radius;
                        element.type = ElementTypes.ElementType.Station;
                        mapElements.Add(element);
                        break;
                    }

                case MapTypes.MapType.MapDefault:
                    {
                        break;
                    }
            }
        }

        public List<Element> GetMapElements()
        {
            return this.mapElements;
        }
    }
}
